package General;

import java.io.Serializable;
import java.util.Arrays;

public class Product implements Serializable {
	private static final long serialVersionUID = 1L;
	
	public static final String GROUND = "Ground";
	public static final String AIR = "Air";
	public static final String AIR_PRIORITY = "Air Priority";
	
	private String fSourceAddress;
	private String fDestinationAddress;
	private String fName;
	private int fWeight;
	private int fDimensionX;
	private int fDimensionY;
	private int fDimensionZ;
	private int fValue;
	private String fCurrency;
	private boolean fHazardous;
	private String fTypeTransport;
	
    public Product(String name, int weight, boolean hazardous, String typeTransport) {
    	fName = name;
    	fWeight = weight;
    	fHazardous = hazardous;
    	fTypeTransport = typeTransport;
    }
    
    public boolean equals(Object object) {
    	return (object.hashCode() == this.hashCode());		
    }
    	
    public int hashCode() {
        return Arrays.hashCode(new Object[] {
                fSourceAddress,   
                fDestinationAddress,
                fName,
                fWeight,
                fDimensionX,
                fDimensionY,
                fDimensionZ,
                fValue,
                fCurrency,
                fHazardous,
                fTypeTransport
         });
    }
    
    public String getName() {
    	return fName;
    }

	public int getWeight() {
		return fWeight;
	}

	public boolean isHazardous() {
		return fHazardous;
	}

	public String getTypeTransport() {
		return fTypeTransport;
	}
    
}